<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List" import="java.util.ArrayList"
	import="domain.Academy"%>
<%@ page import="repository.AcademicDAO" import="java.sql.SQLException"
	import="java.sql.ResultSet"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		List<Academy> allProperty = new ArrayList<Academy>();

		AcademicDAO userDao = null;
		try {
			userDao = new AcademicDAO();
		} catch (SQLException e) {
			e.printStackTrace();
		}

		ResultSet rs = userDao.queryAll();
		try {
			while (rs.next()) {
				Academy user = new Academy();
				user.setID(rs.getString("学院ID"));
				user.setName(rs.getString("学院名称"));
				user.setConInf(rs.getString("联系方式"));
				allProperty.add(user);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		request.setAttribute("propertySco", allProperty);
		request.getRequestDispatcher("register.jsp").forward(request, response);
	%>
</body>
</html>